        <div id="content">
          <div id="posts">
            <h1>发表新文章</h1>
            <br/>
            <ul>
              <li class="alt" id="article_prompt">
                {msg}
              </li>
            </ul>

            <script type="text/javascript" src="j/webeditor/xheditor-zh-cn.min.js"></script>
            <script type="text/javascript">
              $(document).ready(function(){
                // xheditor配置
                $('#post_content').xheditor({
                  upLinkUrl:"upload.php?type=file",
                  upLinkExt:"zip,rar,txt",
                  upImgUrl:"upload.php?type=img",
                  upImgExt:"jpg,jpeg,gif,png",
                  upFlashUrl:"upload.php?type=flash",
                  upFlashExt:"swf",
                  upMediaUrl:"upload.php?type=media",
                  upMediaExt:"avi,mp4,3gp"
                });

                //发表文章时间动态更新
                timestamp = {timestamp};
                window.setInterval(time_run, 1000);

                // 检查数据有效性
                $("#commentform").submit(function(){
                  var post_title = $.trim($("#post_title").val());
                  var post_headline = $.trim($("#post_headline").val());
                  var post_content = $.trim($("#post_content").val());
                  var category = $("#category").val();
                  var tags = $.trim($("#tags").val());

                  var return_re = true;
                  if (post_title.length == 0){
                    $("#prompt_post_title").text("标题不能为空").addClass("prompt");
                    return_re = false;
                  }else if (post_title.length > 100){
                    $("#prompt_post_title").text("最多不得超过100个字符").addClass("prompt");
                    return_re = false;
                  }else{
                    $("#prompt_post_title").text("");
                  }

                  if (post_content.length == 0){
                    $("#prompt_post_content").text("文章内容不能为空").addClass("prompt");
                    return_re = false;
                  }else{
                    $("#prompt_post_content").text("");
                  }

                  if (post_headline.length == 0){
                    $("#prompt_post_headline").text("摘要内容不能为空").addClass("prompt");
                    return_re = false;
                  }else if(post_title.length > 1000){
                    $("#prompt_post_headline").text("摘要内容不得超过1000个字符").addClass("prompt");
                    return_re = false;
                  }else{
                    $("#prompt_post_headline").text("");
                  }

                  if (category == 0){
                    $("#prompt_category").text("请选择一个分类").addClass("prompt");
                    return_re = false;
                  }else{
                    $("#prompt_category").text("");
                  }

                  if (tags.length > 0){
                    if (tags.length > 100){
                      $("#prompt_tags").text("最多不得超过100个字符").addClass("prompt");
                      return_re = false;
                    }else{
                      $("#prompt_tags").text("");
                    }
                  }else{
                    $("#prompt_tags").text("");
                  }
                  return return_re;
                });
                // 计算摘要文本内容字数
                $("#post_headline").keyup(function(){
                  var headline_count = $("#post_headline").val().length;
                  if (headline_count > 1000){
                    $("#prompt_post_headline").text("摘要内容不得超过1000个字符").addClass("prompt");
                  }else{
                    $("#prompt_post_headline").text("字符个数：" + headline_count).removeClass("prompt");
                  }
                });
              });

              function time_run(){
                var d = new Date();
                d.setTime(timestamp);
                timestamp += 1000;

                var second = d.getSeconds();
                if (!second){ // 每逢零秒改变页面显示时间
                  var year = d.getFullYear();
                  var month = d.getMonth();
                  var day = d.getDate();
                  var hour = d.getHours();
                  var minute = d.getMinutes();

                  var nowtime = year + "年" + ++month + "月" + day + "日 " + hour + ":" + minute;
                  $("#display_time").text(nowtime);
                }
              }


            </script>
            <form action="" method="post" id="commentform">

              <input type="hidden" name="id" value="{aid}" />

              <p>
                <label for="post_title">标题：</label>
                <input type="text" name="post_title" id="post_title" value="{post_title}" size="50" tabindex="1" />
                <span id="display_time">{display_time}</span>
                <small><span id="prompt_post_title"></span></small>
              </p>

              <p>
                &nbsp;<small><span id="prompt_post_content"></span></small>
                <br/>
                <textarea name="post_content" id="post_content" style="height:500px; width:650px;" tabindex="2">{post_content}</textarea>
              </p>

              <p>
                <label for="post_headline">摘要：</label>
                <small><span id="prompt_post_headline"></span></small>
                <br/>
                <textarea name="post_headline" id="post_headline" style="height:200px; width:550px;" tabindex="2">{post_headline}</textarea>
              </p>

              <p>
                <label for="category">分类：</label>
                <select name="category" id="category" tabindex="3">
                  {category}
                </select>
                <a href="#">创建分类</a>
                <small><span id="prompt_category"></span></small>
              </p>

              <p>
                <label for="tags">标签：</label>
                <input type="text" name="tags" id="tags" value="{tags}" size="38" tabindex="4" />
                <input type="hidden" name="tags_old" value="{tags}" />
                <small>多个标签用半角逗号（,）隔开。</small>
                <small><span id="prompt_tags"></span></small>
              </p>

              <p>
                <input name="submit" type="submit" id="submit" tabindex="5" value="发 表" />
              </p>

            </form>
          </div>
        </div>